package com.qk.management.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qk.common.PageResult;
import com.qk.dpmain.operatelog.OperateLogDo;
import com.qk.dto.OperateLog.OperateLogDto;
import com.qk.entity.OperateLog;
import com.qk.management.mapper.OperateLogMapper;
import com.qk.management.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @文件名: OperateLogServiceImpl
 * @作者: DX
 * @创建日期: 2025/10/17
 * @描述:
 */
@Slf4j
@Service
@SuppressWarnings("all")
public class OperateLogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLog> implements OperateLogService {

    @Autowired
    private OperateLogMapper operateLogMapper;


    @Override
    public PageResult<OperateLogDo> listOperateLog(OperateLogDto dto) {
        Page page = new Page<OperateLogDto>(dto.getPage(), dto.getPageSize());
        Page<OperateLogDo> list = operateLogMapper.listOperateLog(page, dto);
        return PageResult.<OperateLogDo>builder()
                .total(Long.valueOf(list.getTotal()).intValue())
                .rows(list.getRecords())
                .build();

    }
}
